home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1984 June / 1984-06.d64 / file copier (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  847b  |  36 lines

  1. 10 poke251,peek(52)
  2. 20 poke52,peek(44)+4:poke56,peek(52):clr
  3. 30 print"[147]run this program to"
  4. 40 print"copy a program or"
  5. 50 print"sequential file from"
  6. 60 print"one disk (the source"
  7. 70 print"disk) to another (the"
  8. 80 print"destination disk)."
  9. 90 print"insert source disk."
  10. 100 m=256*peek(52)
  11. 110 open15,8,15
  12. 120 print"what is the name of"
  13. 130 print"the file or program":inputf$
  14. 140 t$="p":print"what is the file type"
  15. 150 print"(p for program, s for"
  16. 160 print"file)"
  17. 170 inputt$
  18. 180 open2,8,2,f$+","+t$+",r"
  19. 190 input#15,e,e$,x,x:ife<>0thenprinte$:close2:goto120
  20. 200 get#2,a$:ifa$=""thena$=chr$(0)
  21. 210 pokem+j,asc(a$):j=j+1:ifst=0then200
  22. 220 close2
  23. 230 print"insert destination"
  24. 240 print"disk and press return"
  25. 250 print"to copy."
  26. 260 getc$:ifc$<>chr$(13)then260
  27. 270 print"press return[146] if you"
  28. 280 print"want to keep the name"
  29. 290 printf$
  30. 300 input"file name ";f$
  31. 310 open2,8,2,f$+","+t$+",w"
  32. 320 input#15,e,e$,x,x:ife<>0thenprinte$:close2:goto300
  33. 330 fork=0toj-1:print#2,chr$(peek(m+k));:next
  34. 340 close2:close15
  35. 350 poke52,peek(251):poke56,peek(251):clr
  36.